import {v4 as uuidv4} from 'uuid'
//要生成一个随机字符串，且每次执行不发生变化，游客身份持久储存
export const getUUID = ()=>{
    //从本地存储 获取uuid
    let uuid_taken = localStorage.getItem('UUIDTOKEN');
    if(!uuid_taken){
        //生成游客身份
        uuid_taken=uuidv4();
        //本地存储
        localStorage.setItem('UUIDTOKEN',uuid_taken);
    }
     return uuid_taken;
}